Make the logic for setting the sensitivity column a bit more clear
authorFederico Mena Quintero <federico@gnome.org>
Wed, 11 Jul 2012 22:50:15 +0000 (17:50 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 15 Jul 2012 04:41:48 +0000 (00:41 -0400)
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkfilechooserdefault.c

index 58245907f5e017bf92cce2832c3ab87a4491027c..19cd8bb5e06dcd0fe8ee0db820879aba637d3e74 100644 (file)
@@ -6845,17 +6845,18 @@ file_system_model_set (GtkFileSystemModel *model,
         {
           gboolean sensitive = TRUE;
 
-          if (impl->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER &&
-              impl->action != GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+          if (!(impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
+               || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
             {
-              sensitive = TRUE;
+              sensitive = TRUE; /* for file modes... */
             }
           else if (!_gtk_file_info_consider_as_directory (info))
             {
-              sensitive = FALSE;
+              sensitive = FALSE; /* for folder modes, files are not sensitive... */
             }
           else
             {
+             /* ... and for folder modes, folders are sensitive only if the filter says so */
               GtkTreeIter iter;
               if (!_gtk_file_system_model_get_iter_for_file (model, &iter, file))
                 g_assert_not_reached ();